import {HTTPP} from '../util/http-p.js'

class OverTimeModel extends HTTPP{
    getToday(uid){
        return this.request({
            url:'overtime/today',
            data:{
                uid: uid
            }
        })
    }

    getWeekList(workerID){
        return this.request({
            url:'overtime/list',
            data:{
                workerID:workerID
            }            
        })
    }

    getPreviousWeek(workerID){
        return this.request({
            url:'overtime/previous',
            data:{
                workerID: workerID
            }
        })
    }

    addOneOverTime(wuid,ot,date){
        return this.request({
            url:'overtime/mini/one',
            data:{
                wuid: wuid,
                over_time: ot,
                date: date
            },
            method: 'POST'
        })
    }

    updateOneOverTime(wuid,ot,date){
        return this.request({
            url:'overtime/mini/one/update',
            data:{
                wuid: wuid,
                over_time: ot,
                date: date
            },
            method: 'PUT'
        })
    }
}

export {
    OverTimeModel
}